package formulation;

import java.util.ArrayList;

import es.deusto.ingenieria.is.csp.formulation.Constraint;
import es.deusto.ingenieria.is.csp.formulation.Variable;

public class LeadDigitConstraint extends Constraint<Integer>
{
	public LeadDigitConstraint(String name, Variable<Integer> variable)
	{
		super(name, new ArrayList<Variable<Integer>>());
		this.addVariable(variable);
	}

	@Override
	public boolean isSatisfied(Variable<Integer> variable, Integer value)
	{
		return !value.equals(0);
	}
	
	public String toString()
	{
		return this.getName() + ": " + this.getVariables().toString();
	}
}